﻿using System;
using XSTDZ.ERP.Application.DataContracts;
using System.Collections.Generic;

namespace XSTDZ.ERP.Application
{
    /// <summary>
    /// 收付款账单 接口
    /// </summary>
    public interface IReceivablePayableService
    {

        Guid AddReceivablePayable(ReceivablePayableBillDto billDto);
        void UpdateReceivablePayable(ReceivablePayableBillDto billDto);
        bool DeleteReceivablePayable(Guid billId);
        ReceivablePayableBillDto GetReceivablePayableBill(Guid billId);
        IList<ReceivablePayableBillDto> GetReceivablePayableBills(IList<Guid> billIds);

        Guid AddReceivablePayableDetail(ReceivablePayableRecordDto billItemDto);
        /// <summary>
        /// 多项收付款操作
        /// </summary>
        /// <param name="billIds"></param>
        /// <param name="billItemDto"></param>
        /// <returns></returns>
        Guid AddReceivablePayableDetail(IList<Guid> billIds, ReceivablePayableRecordDto billItemDto);
        void UpdateReceivablePayableDetail(ReceivablePayableRecordDto billItemDto);
        /// <summary>
        /// 添加收付款账单(明细可为空或一个集合）
        /// </summary>
        /// <param name="billDto"></param>
        /// <param name="billItemsDto"></param>
        // void AddReceivablePayable(ReceivablePayableBillDto billDto,IList<ReceivablePayableRecordDto> billItemsDto);
        /// <summary>
        /// 更新收付款账单(明细可为空或一个集合）
        /// </summary>
        /// <param name="billDto"></param>
        /// <param name="billItemsDto"></param>
        // void UpdateReceivablePayable(ReceivablePayableBillDto billDto, IList<ReceivablePayableRecordDto> billItemsDto);
        /// <summary>
        /// 删除收付款账单及以下的所有明细行（逻辑删除）
        /// </summary>
        /// <param name="ids"></param>
        void DeleteReceivablePayable(IList<Guid> billIds);
        /// <summary>
        ///  删除收付款账单明细行（逻辑删除）
        /// </summary>
        /// <param name="billItemIds"></param>
        void DeleteReceivablePayableItem(IList<Guid> billItemIds);

        /// <summary>
        /// 删除指定收付款账单下所有明细
        /// </summary>
        /// <param name="returnBillId"></param>
        void ConvertReturnBillDeleteState(Guid returnBillId);
        /// <summary>
        /// 删除指定收付款账单下指定明细
        /// </summary>
        /// <param name="returnBillId"></param>
        /// <param name="returnBillDetailIds"></param>
        void ConvertReturnBillDeleteState(Guid returnBillId, IEnumerable<Guid> returnBillDetailIds);
        /// <summary>
        /// 获取所有收付款账单(分页)
        /// </summary>
        /// <param name="recordCounts"></param>
        /// <param name="index"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        IList<ReceivablePayableBillDto> getReceivablePayableBills(out int recordCounts, int index, int pageSize);
        IList<ReceivablePayableRecordDto> getReceivablePayableBillDetails(Guid billId);

        ReceivablePayableRecordDto ReceivablePayableRecord(Guid Id);
    }
}
